#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int a,b,n;
  while (scanf("%d",&n)!=EOF){
    if(!n)break;
    b=0;
    while (n){
    cin>>a;
    b+=a;
    n--;
  }
  cout<<b<<endl;
  }
}